﻿using System;

namespace WebAPI.Utils
{
    public class Server
    {
        /// <summary>
        /// 获取操作系统版本
        /// </summary>
        /// <returns></returns>
        public static string GetSystemVersion()
        {
            return Environment.OSVersion.ToString();
        }

        /// <summary>
        /// 服务器计算机名称
        /// </summary>
        /// <returns></returns>
        public static string GetServerName()
        {
            //return HttpContext.Current.Server.MachineName;
            return null;
        }

        /// <summary>
        /// 服务器IP地址  
        /// </summary>
        /// <returns></returns>
        public static string GetServerIp()
        {
            //return HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"];
            return null;
        }

        /// <summary>
        /// 服务器域名  
        /// </summary>
        /// <returns></returns>
        public static string GetDomainName()
        {
            //return HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
            return null;
        }

        /// <summary>
        /// .NET解释引擎版本
        /// </summary>
        /// <returns></returns>
        public static string GetDotNetVersion()
        {
            return ".NET CLR" + Environment.Version.Major + "." + Environment.Version.Minor + "." + Environment.Version.Build + "." + Environment.Version.Revision;
        }

        /// <summary>
        /// IIS版本
        /// </summary>
        /// <returns></returns>
        public static string GetServerSoftware()
        {
            //return HttpContext.Current.Request.ServerVariables["SERVER_SOFTWARE"];
            return null;
        }

        /// <summary>
        /// HTTP访问端口  
        /// </summary>
        /// <returns></returns>
        public static string GetServerPort()
        {
            //return HttpContext.Current.Request.ServerVariables["SERVER_PORT"];
            return null;
        }

        /// <summary>
        /// 虚拟目录的绝对路径  
        /// </summary>
        /// <returns></returns>
        public static string GetApplRhysicalPath()
        {
            //return HttpContext.Current.Request.ServerVariables["APPL_RHYSICAL_PATH"];
            return null;
        }

        /// <summary>
        /// 执行文件的绝对路径  
        /// </summary>
        /// <returns></returns>
        public static string GetPathTranslated()
        {
            //return HttpContext.Current.Request.ServerVariables["PATH_TRANSLATED"];
            return null;
        }

        /// <summary>
        /// 虚拟目录Session总数 
        /// </summary>
        /// <returns></returns>
        public static string GetSessionCount()
        {
            //return HttpContext.Current.Session.Contents.Count.ToString();
            return null;
        }

        /// <summary>
        /// 虚拟目录Application总数  
        /// </summary>
        /// <returns></returns>
        public static string GetApplicationCount()
        {
            //return HttpContext.Current.Application.Contents.Count.ToString();
            return null;
        }

        /// <summary>
        /// 服务器区域语言 
        /// </summary>
        /// <returns></returns>
        public static string GetAcceptLanguage()
        {
            //return HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"];
            return null;
        }

        /// <summary>
        /// CPU个数    
        /// </summary>
        /// <returns></returns>
        public static string? GetCpuCount()
        {
            return Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS");
        }

        /// <summary>
        /// CPU类型 
        /// </summary>
        /// <returns></returns>
        public static string? GetCpuIdentifier()
        {
            return Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER"); 
        }
    }
}